package com.runmi.webchat.aftersale.dbcore.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.runmi.webchat.aftersale.dbcore.entity.MemberInfo;
import com.runmi.webchat.aftersale.dbcore.entity.SetupItem;
import com.runmi.webchat.aftersale.dbcore.mapper.MemberInfoMapper;

@Repository
public class MemberInfoDao {

	@Autowired
	private MemberInfoMapper memberInfoMapper;
	
	public MemberInfo getMemberInfoByMobile(String mobile){
		MemberInfo record=new MemberInfo();
		record.setMobile(mobile);
		List<MemberInfo> items= memberInfoMapper.select(record);
		if(null!=items && items.size()>0){
			return items.get(0);
		}else{
			return null;
		}
	}
	public MemberInfo getMemberInfoByOpenId(String openId){
		MemberInfo record=new MemberInfo();
		record.setOpenId(openId);
		List<MemberInfo> items= memberInfoMapper.select(record);
		if(null!=items && items.size()>0){
			return items.get(0);
		}else{
			return null;
		}
	}
}
